<nz-spin [nzSpinning]="isSpinning" [nzTip]="'正在初始化模块信息...'">
  <section class="in-index" *ngIf="viewType==0 ">
    <div class="table-operations" style="margin: 32px 0;padding: 0 2%;">
      <button nz-button (click)="goBack()">
        <i class="anticon anticon-rollback"></i>
        <span>返回</span>
      </button>
      <button nz-button (click)="getEntityList()" [nzLoading]="loadingData">
        <i class="anticon anticon-reload"></i>
        <span>刷新</span>
      </button>
    </div>
    <!-- 搜索内容 -->
    <div class="table-bg" style="background: #ef4954;height: 60px;width: 100%;display:flex;align-items: center;justify-content: flex-start;width: 96% !important;margin: 0 auto;border-radius:4px !important;padding-left: 16px !important;">
      <form nz-form [nzLayout]="'inline'">
        <nz-form-item >
          <nz-form-control style="width: 200px;">
            <nz-select  nzShowSearch nzAllowClear nzPlaceHolder="请选择课程" name="selectSubjectId" [(ngModel)]="selectSubjectId" (ngModelChange)="getClass($event)">
              <nz-option *ngFor="let item of lstSubject" [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-control style="width: 200px;">
            <nz-select  nzShowSearch nzAllowClear nzPlaceHolder="请选择班级" name="selectClassId" [(ngModel)]="selectClassId">
              <nz-option *ngFor="let item of lstClass" [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-control>
            <input nz-input placeholder="学生姓名" [(ngModel)]="searchText" name="searchText">
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-control>
            <button nz-button (click)="search()">搜索</button>
          </nz-form-control>
        </nz-form-item>
      </form>
    </div>
    <!-- end 搜索框 -->

    <nz-table #nzTable #nzFixedHeader nzBordered [nzLoading]="loadingData" [nzFrontPagination]="false" [nzData]="listEntities.entities"
    [nzTotal]="listEntities.recordTotalCount" [(nzPageIndex)]="listEntities.currentPageIndex" (nzPageIndexChange)="getEntityListAsync(true)"
    [(nzPageSize)]="listEntities.pageSize">
    <thead nz-thead>
      <tr>
        <ng-container *ngFor="let formCol of arSystemFormControls">
          <th [nzShowSort]="formCol.canSortable" [(nzSort)]="sortField[formCol.fieldName]" (nzSortChange)="sort(formCol.fieldName,$event)"
            style="text-align: center;" *ngIf="formCol.showInTable">
            <span>{{formCol.fieldCaption}}</span>
          </th>
        </ng-container>
      </tr>
    </thead>
    <tbody nz-tbody style="text-align: center;">
      <tr nz-tbody-tr *ngFor="let item of nzTable.data">
      
        <ng-container *ngFor="let formCol of arSystemFormControls">
          <td nz-td *ngIf="formCol.showInTable">
            <ng-container [ngSwitch]="formCol.fieldType">
              <span *ngSwitchCase="7">{{(item[formCol.fieldName]?item[formCol.fieldName]:'') | cnBoolean | dictionary:formCol.fieldData}}</span>
              <!-- 图片 -->
              <span *ngSwitchCase="10">
                <img *ngIf="item[formCol.fieldName]" (click)="showImageView(httpService.IP_PORT+item[formCol.fieldName])" [src]="httpService.IP_PORT+item[formCol.fieldName]"
                  class="avatar" style="height: 30px;width: 30px; cursor: pointer; margin: 0 auto;">

                <img *ngIf="!item[formCol.fieldName]" [src]="httpService.IP_PORT+'/userfiles/userphotos/timg.jpg'" class="avatar" style="height: 30px;width: 30px;margin: 0 auto;">
              </span>
              <!-- upload -->
              <span *ngSwitchCase="11">
                <a [href]="httpService.IP_PORT+item[formCol.fieldName]" target="_blank">下载文件</a>
              </span>
              <span *ngSwitchCase="13">
                <span style="width: 30px;height: 30px;background-color: gray;"></span>
              </span>
              <span *ngSwitchDefault>{{item[formCol.fieldName] | dictionary:formCol.fieldData}}</span>
            </ng-container>
          </td>
        </ng-container>
      </tr>
    </tbody>
  </nz-table>
  </section>
</nz-spin>
